package pl.diagnoser.client.tools;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;

import pl.diagnoser.client.dto.AppDTO;
import pl.diagnoser.client.dto.AttributeDictDTO;
import pl.diagnoser.client.dto.AttributeValuesDictDTO;
import pl.diagnoser.client.dto.DefectDictDTO;
import pl.diagnoser.client.dto.DiagnoserResultDTO;
import pl.diagnoser.client.dto.DiagnoserResultsDTO;
import pl.diagnoser.client.dto.EstimateDTO;
import pl.diagnoser.client.dto.ObjectHistoryViewer;
import pl.diagnoser.client.dto.SearchResultAttributesDTO;
import pl.diagnoser.client.dto.SearchResultDTO;
import pl.diagnoser.client.dto.SymptomDTO;
import pl.diagnoser.client.dto.SymptomDictDTO;
import pl.diagnoser.client.dto.UserDTO;
import pl.diagnoser.client.dto.ObjectAttributesDTO;
import pl.diagnoser.client.dto.ObjectsDTO;
import pl.diagnoser.client.formulas.DiagnoserHBFormula;
import pl.diagnoser.client.formulas.DiagnoserIFormula;
import pl.diagnoser.client.formulas.DiagnoserSFormula;
import pl.diagnoser.client.formulas.DiagnoserVFormula;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("dataGetter")
public interface DataGetterService extends RemoteService {
	
	List<ObjectsDTO> getListOfAllObjects();
	Long saveNewObject(String objectName, String objectDate, HashMap<String, String> objectAttributes, HashMap<String, List<String>> objectMultipleAttributes);
	List<DiagnoserResultDTO> getPossibleDefects(List<SearchObjectAttribute> searchCriteria, List<SearchObjectAttribute> emptySearchCriteria, boolean fast);
	List<DefectDictDTO> getPossibleDefects(ObjectsDTO object, List<SymptomDTO> symptoms);
	String getWidgetTitle(String widgetName);
	List<DiagnoserResultsDTO> getLearnResult(Integer mode, Double slider);
	List<DiagnoserHBFormula> getHBFormulas();
	List<DiagnoserVFormula> getVFormulas();
	List<DiagnoserSFormula> getSFormulas();
	List<DiagnoserIFormula> getIFormulas();
	String saveImplication(List<String> implications);
	List<AttributeDictDTO> getAttributeList(boolean loadValues);
	List<AttributeValuesDictDTO> getAttributeValuesList();
	String saveAttribute(String attribute, int isDate, int isMultiple, int isFile);
	String removeAttribute(String attribute);
	String saveAttributeValue(String attribute, String attributeValue);
	String removeAttributeValue(String attribute, String attributeValue);
	Set<ObjectAttributesDTO> getObjectAttributes(Long objectId);
	UserDTO getUser(String login, String password);
	List<UserDTO> getUserList();
	String saveUser(UserDTO user);
	String removeUser(long userID);
	ArrayList<String> getAttributeValue(String attributeName);
	String saveSearching(List<SearchObjectAttribute> objectAttributes, long objectId);
	List<SearchResultDTO> getSearchResultForObject(long objectId);
	List<SearchResultAttributesDTO> getHistorySearchAttributes(long searchID);
	String openPdfFile(String fileName);
	String getWebPageForArticle(String article);
	
	/////
	List<ObjectHistoryViewer> getEstimateForObject(Long id);
	List<SymptomDictDTO> getSymptomsList();
	List<DefectDictDTO> getDefectsList();
	String saveDefect(String newValue);
    String saveSymptom(String newValue);
    String removeDefects(List<String> defects);
    String removeSymptoms(List<String> symptoms);
    Boolean saveNewEstimate(EstimateDTO estimate, List<SymptomDTO> symptoms);
    List<AppDTO> getAllApp();
    String updateApp(Long appID, int isActive, String appName, int isSearchMode);
    String removeApp(String appName);
    String getHibernateConfig();
}
